/**
 * 
 */
package service;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import security.SecurityRole;

/**
 * The Service Declaration.
 * 
 * @author chuxiaoyuan
 *
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Service {

	/**
	 * Service Name.
	 * 
	 * @return the service name.
	 */
	String name();
	
	/**
	 * Service type.
	 * 
	 * @return the service type.
	 */
	ServiceType type() default ServiceType.NoDB;
	
	/**
	 * The Security role for this service.
	 * 
	 * @return the security role.
	 */
	SecurityRole security() default SecurityRole.None;
	
	/**
	 * Service type.
	 * 
	 * @author chuxiaoyuan
	 */
	public enum ServiceType {
		
		NoDB,			// No database service.
		
		Transaction,	// Transaction services: need to maintain transactions
		
		Query			// Query services: no transaction required
	}
}
